package com.itheima.reggie.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.itheima.reggie.config.LocalDateTimeConverter;
import com.itheima.reggie.config.SexConverter;
import com.itheima.reggie.config.StatusConverter;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class Employee implements Serializable {
    private static final long serialVersionUID = 1L;
    @ExcelProperty("编号")
    private Long id;
    @ExcelProperty("用户账号")
    private String username;
    @ExcelProperty("用户名")
    private String name;
    @ExcelIgnore
    private String password;
    @ExcelProperty("手机号")
    private String phone;
    @ExcelProperty(value = "性别",converter = SexConverter.class)
    private String sex;
    @ExcelIgnore
    private String idNumber; //驼峰命名法 ---> 映射的字段名为 id_number
    @ExcelProperty(value = "售卖状态",converter = StatusConverter.class)
    private Integer status;
    @ExcelProperty(value = "创建时间",converter = LocalDateTimeConverter.class)
    @TableField(fill = FieldFill.INSERT)
    //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ExcelProperty(value = "更新时间",converter = LocalDateTimeConverter.class)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;//登录人的id
    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;


    @ExcelProperty("创建人")
    @TableField(fill = FieldFill.INSERT)
    private String crUser;//登录人的id
    @ExcelProperty("修改人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String upUser;


}
